home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / gset01.zip / GSET.C next >
C/C++ Source or Header  |  1993-01-19  |  558b  |  26 lines

  1. #include <ctype.h>
  2. #include <dos.h>
  3. #include <stdlib.h>
  4.  
  5. void main(int argc, char **argv)
  6. {
  7. char flag, line=1, mic=0, out=2;
  8. char *ptr;
  9. int i, base=512;
  10.  
  11.   ptr = getenv("ULTRASND");
  12.   if (ptr == NULL) base=544; // default: 220h (256*2+16*2)
  13.   else {
  14.     char abase[2];
  15.     abase[0]=ptr[0]; abase[1]=0;
  16.     base+=(atoi( abase)<<4);
  17.   }
  18.   if (argc==2)
  19.     for(i=0; i<3; i++) {
  20.       flag=toupper(argv[1][i]);
  21.       if(flag=='M') mic=4;
  22.       if(flag=='L') line=0;
  23.       if(flag=='O') out=0;
  24.     }
  25.   outportb( base, mic | line | out);
  26. }